import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 社区帖子
 */
@Entity('community_post')
export class CommunityPostEntity extends BaseEntity {
  @Column({ comment: '内容', type: 'text' })
  content: string;

  @Column({ comment: '图片列表', type: 'json', nullable: true })
  imageList: string[];

  @Column({ comment: '用户头像', nullable: true })
  userAvatar: string;

  @Column({ comment: '用户昵称', nullable: true })
  userNickname: string;

  @Column({ comment: '状态', dict: ['禁用', '启用'], default: 1 })
  status: number;

  @Column({ comment: '浏览数', default: 0 })
  viewCount: number;

  @Column({ comment: '点赞数', default: 0 })
  likeCount: number;

  @Column({ comment: '置顶状态', dict: ['否', '是'], default: 0 })
  topStatus: number;

  @Column({ comment: '置顶排序优先级', default: 0 })
  topPriority: number;
}
